﻿'Programmé par Michel Gagnon
Public Class ListePersonneRessource
    Dim oLocalContext As DBMainContext
    Dim oBenef As Beneficiaire
    Public Sub New(ByVal oBenef As Beneficiaire, ByVal localcontext As DBMainContext)

        InitializeComponent()
        Me.oBenef = oBenef
        oLocalContext = localcontext
        dgvPersonneRessource.DataSource = obenef.Pers_Ressource
        dgvPersonneRessource.Columns("ID").Visible = False
        dgvPersonneRessource.Columns("ID_Beneficiaire").Visible = False
        dgvPersonneRessource.Columns("Pays").Visible = False
        dgvPersonneRessource.Columns("Province").Visible = False
        dgvPersonneRessource.Columns("CodePostal").Visible = False
        dgvPersonneRessource.Columns("Ville").Visible = False
        dgvPersonneRessource.Columns("Adresse").Visible = False
        dgvPersonneRessource.Columns("Beneficiaire").Visible = False


    End Sub

    Private Sub btnAjouter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAjouter.Click
        Dim oNewPersResc As New GestionPersonneRessource(oBenef)
        'MainForm.AddTabToTC("Personne Ressource", True, oNewPersResc)
        Dim ocust As New CustomMessageBox
        ocust.Height = oNewPersResc.Height + 90
        ocust.Width = oNewPersResc.Width
        ocust.Controls.Add(oNewPersResc)

        ocust.ShowDialog()
    End Sub

    Private Sub dgvPersonneRessource_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvPersonneRessource.DoubleClick
        Dim oPersResc As Pers_Ressource
        oPersResc = CType(dgvPersonneRessource.SelectedRows(0).DataBoundItem, Pers_Ressource)
        Dim oNewIPers As New GestionPersonneRessource(oPersResc, oBenef)
        'MainForm.AddTabToTC("Beneficiaire:" + oPersResc.Nom + "," + oPersResc.Prenom, True, oNewIBene)

        Dim ocust As New CustomMessageBox
        ocust.Height = oNewIPers.Height + 90
        ocust.Width = oNewIPers.Width
        ocust.Controls.Add(oNewIPers)

        ocust.ShowDialog()

    End Sub

    Private Sub btnOuvrir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOuvrir.Click
        Dim oPersResc As Pers_Ressource
        'Gerer le open si la liste est vide ds tt les liste 
        oPersResc = CType(dgvPersonneRessource.SelectedRows(0).DataBoundItem, Pers_Ressource)
        Dim oNewIPers As New GestionPersonneRessource(oPersResc, oBenef)
        'MainForm.AddTabToTC("Beneficiaire:" + oPersResc.Nom + "," + oPersResc.Prenom, True, oNewIBene)

        Dim ocust As New CustomMessageBox

        ocust.Height = oNewIPers.Height + 90
        ocust.Width = oNewIPers.Width
        ocust.Controls.Add(oNewIPers)

        ocust.ShowDialog()

    End Sub

    Private Sub dgvPersonneRessource_CellContentClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvPersonneRessource.CellContentClick

    End Sub

    Private Sub btnSupprimer_Click(sender As System.Object, e As System.EventArgs)

    End Sub
End Class
